<template>
  <div class="common-search-header">
    <form @submit.prevent="handleSearchKeyword(keyword)">
      <el-input placeholder="请输入关键词" v-model="keyword" />
    </form>
  </div>
</template>

<script>
export default {
  data() {
    return {
      keyword: ''
    }
  },

  methods: {
    handleSearchKeyword(keyword) {
      if (keyword.trim().length) {
        location.href = `/search?keyword=${keyword}`;
      }
    }
  }
}
</script>

<style lang="scss" scoped>
.common-search-header {
  /deep/ .el-input__inner {
    width: 200px;
  }
}
</style>